package com.chinamobile.ln.ictenterprises.utils;

import com.chinamobile.ln.ictenterprises.common.MainApplication;

import android.app.AlertDialog;
import android.content.Context;
import android.content.DialogInterface;

public class AlertDialogUtil
{
    public static void exit(final Context context, int title, int msg)
    {
        new AlertDialog.Builder(context).setTitle(title).setMessage(msg)
            .setNegativeButton("取消", new DialogInterface.OnClickListener() {
                @Override
                public void onClick(DialogInterface dialog, int which)
                {

                }
            }).setPositiveButton("确定", new DialogInterface.OnClickListener() {
                @Override
                public void onClick(DialogInterface dialog, int which)
                {
                    ActivityStackManager.getManager().exitApp(context);
                    MainApplication.getInstance().getIDatabase()
                        .deleteOutTimeCache();
                }
            }).show();
    }

}
